#include "Headers.h"
#include "MenuScene.h"


CMenuScene::CMenuScene(void)
{
}


CMenuScene::~CMenuScene(void)
{
	this->Uninitialize();
}

bool CMenuScene::Initialize()
{
	IS_FALSE(m_ImageManager.AddUIImage(IDB_MENUFRAME, 0, 0));
	IS_FALSE(m_ButtonManager.AddButton(IDB_ITEM_U_M, IDB_ITEM_S_M, 389, 205, true, ItemButton));
	IS_FALSE(m_ButtonManager.AddButton(IDB_SAVE_U_M, IDB_SAVE_S_M, 389, 292, false, SaveButton));
	IS_FALSE(m_ButtonManager.AddButton(IDB_LOAD_U_M, IDB_LOAD_S_M, 389, 379, false, LoadButton));
	IS_FALSE(m_ButtonManager.AddButton(IDB_MAINMENU_U_M, IDB_MAINMENU_S_M, 389, 466, false, MainMenuButton));
	IS_FALSE(m_ButtonManager.AddButton(IDB_EXIT_U_M, IDB_EXIT_S_M, 389, 659, false, ExitButton));

	return true;
}

void CMenuScene::Uninitialize()
{
	m_ButtonManager.RemoveButton();
}

void CMenuScene::Process()
{
	if(InputManager()->GetKeyState('Z') == KEY_DOWN)
	{
		Application()->GetSceneManager()->ReloadScene();
		return;
	}

	m_ButtonManager.Update();
}

void CMenuScene::Render(HDC hdc)
{
	m_ImageManager.Render(hdc);
	m_ButtonManager.Render(hdc);
}